<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>提交评价</title>
<style type="text/css">
			.goods{
				height:auto;
				width:240px;
				border: 1px solid #ddd;
				margin-left:70px;
				float: left;
			}
			.goodshead{
				height:40px;
				width:240px;
				border-bottom: 1px solid #ddd;
				line-height: 40px;
				background-color:#F9F9F9 ;
			}
			.ti{
				margin-left: 10px;
				color: #555;
				font-weight: 700;
			}
			.goodsbody{
				height:180px;
				width: 180px;
				margin-left: 25px;
				margin-top: 10px;
			}
			.goodspic{
				height:180px;
				width: 180px;
			}
			.goodsfoot{
				height: auto;
				width: 216px;
				margin-left:10px;
				margin-top: 10px;
				font-size: 14px;
			}
			.goodsfooter{
				height: 30px;
				width: 220px;
				margin-top: 10px;
				margin-left:10px;
			}
			.goodscomments{
				float: right;
				font-size: 13px;
				line-height: 30px;
				color: #555555;
				
			}
			.goodsprice{
				color: #CA151D;
				float: left;
				line-height: 30px;
				font-weight: 700;
			}
			.dindan{
				height:40px;
				width:80px;
				text-align:center;
				line-height:40px;
				color:#555;
				background-color:#f0f0f0;
				font-size: 14px;
				font-weight: 700;
			}
			.dindanhezi{
				height:40px;
				width:900px;
				border-bottom:1px solid #f0f0f0;
				margin-bottom:10px;
				margin-left:330px;
				text-align:left;
			}
			
			.goodsborder{
				width: 800px;
				margin-left:330px;
			}
			.bordertd1{
				width: 150px;
				text-align: right;
				font-size: 14px;
				height: 50px;
				color:#555555;
				font-weight: 700;
			}
			.bordertd2{
				font-size: 14px;
				height: 50px;
				color:#555555;
			}
			.button1{
				background-color: #CA151D ;
				border: 1px solid  #CA151D;
				color: white;
				height: 35px;
				width: 120px;
				font-size: 14px;
			}
			.star{
				height:20px;
				width:20px;
			}
			.hcommentjsp{
			padding-top:50px;
			}
		</style>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#tankuang_body_head2").change(function(){
		var file=$(this)[0].files[0];
		console.log(file);

		var formObj = new FormData();
		formObj.set('image', file);
		$.ajax({
			url : 'img?action=add',
			data : formObj,
			type : 'POST',
			dataType : 'json',
			processData : false,
			contentType : false,
			success : function(e) {
			/* console.log(res.id);
			console.log(res.folder); */
				var img = $("<div style='float:left;'><img src='uploads\\"+ e.p_newname+ " ' onclick='delimg(this)' style='cursor:pointer ;width:100px'><input type='hidden' name='p_newname' value='"+e.p_newname+"'><input type='hidden' name='p_oldname' value='"+e.p_oldname+"'><input type='hidden' name='p_width' value='"+e.p_width+"'><input type='hidden' name='p_height' value='"+e.p_height+"'><input type='hidden' name='p_size' value='"+e.p_size+"'><a href='javascript:;' id='close'><i class='fa fa-close'></i></a></div>");
				$("#yulan").append(img);
			},
			error:function(e){
				msgbox('提示','操作失败!','',null,0,'error');
			}
		});
	});			
});

</script>
</head>
<body>
<div ><%@include file="chead.jsp" %></div>
<div class="hcommentjsp"></div>
<div class="goods">
			<div class="goodshead">
				<span class="ti">
					商品信息
				</span>
			</div>
			<div class="goodsbody">
				<img class="goodspic" src="${list.getP_newname() }" />
			</div>
			<div class="goodsfoot">
				${list.getG_name() }
			</div>
			<div class="goodsfooter">
				<div class="goodsprice">￥${list.getG_price() }</div>
			</div>
		</div>
		<div class="dindanhezi">
			<div class="dindan">
				<span>我要评论</span>	
			</div>
		</div>
		<div class="bodycom">
			<form action="goodapp?action=Comment&id=${list.getG_code()}&curpage=1" method="post" >
				<table class="goodsborder" >
					<tr>
						<td class="bordertd1" style="height: 30px;">评论等级：</td>
						<td>
							<label>
								<input type="radio" value="5" name="fenshu"/><img class="star" src="image/star.png"/>
								<img class="star" src="image/star.png"/><img class="star" src="image/star.png"/>
								<img class="star" src="image/star.png"/><img class="star" src="image/star.png"/>
							</label>
							
							<label>
								<input type="radio" value="4" name="fenshu"/><img class="star" src="image/star.png"/>
								<img class="star" src="image/star.png"/><img class="star" src="image/star.png"/>
								<img class="star" src="image/star.png"/>
							</label>
							
							<label>
							<input type="radio" value="3" name="fenshu"/><img class="star" src="image/star.png"/>
							<img class="star" src="image/star.png"/><img class="star" src="image/star.png"/>
							</label>
							
							<label>
							<input type="radio" value="2" name="fenshu"/>
							<img class="star" src="image/star.png"/><img class="star" src="image/star.png"/>
							</label>
							
							<label>
								<input type="radio" value="1" name="fenshu"/><img class="star" src="image/star.png"/>
							</label>
						</td>
					</tr>
					<tr>
						<td class="bordertd1" style="height: 100px;">评论内容：</td>
						<td class="bordertd2">
							<textarea name="pinglun" style="width:300px; height:80px;"></textarea>
						</td>
					</tr>
					<tr>
						<td class="bordertd1" style="height: 45px;">上传图片：</td>
						<td class="bordertd2">
						选择文件：<input type="file" name="img" id="tankuang_body_head2"><br/>
     					<div id="yulan"></div>
						</td>
					</tr>
					<tr>
						<td class="bordertd1"></td>
						<td><input class="button1" type="submit" value="我要评价"/></td>
					</tr>
				</table>
			</form>
		</div>
	</body>
<div style="margin-top:50px;" ><%@include file="cfooter.jsp" %></div>
</body>
</html>